package com.ssmk.utlis;

import android.content.Context;
import android.content.SharedPreferences;

import static android.content.Context.MODE_PRIVATE;

/**
 * Created by Administrator on 2017/9/4 0004.
 */

public class LoginStatus {
    private static class InSide{
        private static LoginStatus status = new LoginStatus();
    }
    //私有化构造器
    private LoginStatus(){

    }
    public static LoginStatus getInstance(){
        return InSide.status;
    }
    public static boolean getLoginStatus(Context context){
        SharedPreferences personInfo = context.getSharedPreferences("personInfo", MODE_PRIVATE);
        boolean loginState = personInfo.getBoolean("loginState", false);
        String iconurl = personInfo.getString("iconurl", null);
        return loginState;
    }
}
